package com.zhengx.blelib;

import android.app.Application;
import android.util.Log;

import com.zhengx.blehelper.BleManager;

/**
 * Created by zhengx on 2018/10/31
 */
public class MyApp extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        boolean initRet = BleManager.init(this)
                .setScanTimeout(6 * 1000)
                .addNameFilter("测量盒子")
                .addNameFilter("H10C")
//                .addNameFilter("[事农小盒]")
                .addNameFilter("HYL.BT.GPS")
                .apply();

        if (initRet) {
            Log.e("app", "blemanager init success");
        } else {
            Log.e("app", "blemanager init success");
        }
    }

    @Override
    public void onTerminate() {
        super.onTerminate();
        BleManager.getInstance().release();
    }
}
